package com.mdd.service.impl;

import com.mdd.dao.UserDao;
import com.mdd.entity.User;
import com.mdd.service.UserService;
import lombok.Data;

// 具体请的厨师，是一个具体可以执行厨师岗位职责的人
@Data
public class UserServiceImpl implements UserService {
    // 厨师做菜，要依赖采购员采购的材料，所以把采购员注入起来
    private UserDao userDao;


    @Override
    public Boolean removeUserById(int id) {
        int i = userDao.deleteUserById(id);
        return i>0;// 根据受影响行业判断成功与否
    }

    @Override
    public User getUserById(int id) {
        User user = userDao.selectUserById(id);
        user.setUsername("张三");
        return user;
    }
}
